﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoungeRepo.Core;

namespace ChangingTheSchema
{
    class Program
    {
        static void Main(string[] args)
        {
            using(var repo = new LoungeRepository(@"..\..\..\ChangingTheSchema.Repo"))
            {
                repo.Store(new FieldsToBeAdded { F1 = "hello" }, "fieldsToBeAdded");
                repo.Store(new FieldsToBeRemoved {F1 = "world", F2 = 42}, "fieldsToBeRemoved");
                repo.Store(new FieldsToChangeType { F1 = 42, F2 = 99, F3 = new StringBuilder("hello") }, "fieldsToChangeType");

                Console.WriteLine("3 entities stored");
            }
        }
    }


    class FieldsToBeAdded
    {
        public string F1;
    }

    class FieldsToBeRemoved
    {
        public string F1;
        public int F2;
    }

    class FieldsToChangeType
    {
        public int F1;
        public int F2;
        public StringBuilder F3;
    }
}
